package com.eningqu.aipen.viewmodel.login;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.eningqu.aipen.logic.Repository;
import com.eningqu.aipen.logic.model.login.LoginUserBean;

/**
 * Package:com.eningqu.aipen.viewmodel.login
 * Author:starr
 * Time:2023/9/14  13:15
 * Description:
 */
public class LoginViewModel extends ViewModel {
    private MutableLiveData<LoginUserBean> loginUserData=new MutableLiveData<>();

    public LoginUserBean getUserInfo(){
        if(loginUserData==null){
            setLoginUserData(Repository.getInstance().getUserInfo());
        }
        return loginUserData.getValue();
    }

    public void setLoginUserData(LoginUserBean bean){
        loginUserData.setValue(bean);
    }

}
